var express = require('express');

const UserController = require('../../controllers/admin/UserController');
var UserRouter = express.Router();

//头像上传中间件
const multer = require('multer')
const upload = multer({ dest: 'public/uploads/avatar' })

UserRouter.post('/adminapi/user/login', UserController.login);
UserRouter.post('/adminapi/user/upload', upload.single('file'), UserController.upload);
UserRouter.post('/adminapi/user/add', upload.single('file'), UserController.addUser);
UserRouter.get('/adminapi/user/list', UserController.findUserList);
UserRouter.delete('/adminapi/user/list/:id', UserController.deleteUser);
UserRouter.put('/adminapi/user/list/:id', UserController.updateUser);

module.exports = UserRouter;
